Skip to content

fix(web-ui): stabilize FlowChat history paging - #1925

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2
Jul 31, 2026
Merged

fix(web-ui): stabilize FlowChat history paging#1925
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1537

FlowChat history paging no longer replaces the active scroller during upward navigation. The existing static history viewport stays mounted, expands before prepend, and restores the visible user-message anchor across both expansion and older-history insertion.

The loading sentinel is shown only while older history remains available. It is removed when isPartial becomes false, so the first turn aligns directly with the chat header.

Type and Areas

Type:

Regression fix / UI/UX / test

Areas:

Web UI / FlowChat / virtual message list

Motivation / Impact

Previously, scrolling toward the oldest loaded turn could insert a large estimated spacer, briefly blank the viewport, and restore the user to the wrong position. An intermediate attempt to switch from the static list to Virtuoso during the scroll transaction could also return the viewport to the latest turn.

This change keeps the scroller stable, preserves a semantic message anchor, loads older turns near the actual boundary, and removes the loading placeholder once the first turn is reached.

Verification

  • pnpm exec vitest run src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx src/flow_chat/components/modern/VirtualMessageList.layout.test.ts --pool=threads --maxWorkers=1 --no-file-parallelism from src/web-ui
    • 63 tests passed
  • pnpm run type-check:web
    • Passed
  • pnpm exec eslint src/flow_chat/components/modern/VirtualMessageList.tsx --no-warn-ignored from src/web-ui
    • Passed
  • git diff --check
    • Passed
  • Manual reproduction confirmed the main history paging behavior; the final first-turn sentinel removal is covered by the focused regression test.

Reviewer Notes

  • The static scroller remains active during the paging transaction; no renderer switch occurs while the user is scrolling.
  • The semantic anchor is a rendered user-message element and is restored in a layout effect before the next paint.
  • The loading sentinel reserves a fixed height while partial history remains, preventing layout movement when its visibility changes.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

- Keep the static history scroller mounted while prepending older turns.
- Restore a semantic user-message anchor across window expansion and prepend.
- Trigger pagination near the loaded-history boundary with a fixed loading sentinel.
- Remove the sentinel after the full history has been revealed.
- Add focused regression coverage for paging boundaries and static expansion.
@wsp1911
wsp1911 merged commit 9ed5c5f into GCWing:main Jul 31, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 长会话中向上滚动历史时出现刷新闪烁和短暂空白

1 participant